package a.f.d;

import a.c.bb;
import a.c.e;
import a.c.k;
import a.c.v;
import a.c.w;
import a.c.x;
import a.f.o;
import a.i.l;

import java.io.Serializable;
import java.util.*;

class cb
  implements gb
{
  b_ a;
  private gb b;
  private k c;
  private boolean d;
  private Comparator e = new a_();
  
  void a(gb paramgb, k paramk)
  {
    this.b = paramgb;
    this.c = paramk;
  }
  
  public void a(Object paramObject)
  {
    if (f.o == 0) {
      if (!(paramObject instanceof Map)) {
        throw new IllegalArgumentException("Unknown memento type!");
      }
    }
    Map localMap = (Map)paramObject;
    this.a = ((b_)localMap.get("y.layout.hierarchic.MementoSequencer.SequencerMemento"));
  }
  
  public void c(Object paramObject)
  {
    if (f.o == 0) {
      if (!(paramObject instanceof Map)) {
        throw new IllegalArgumentException("Unknown memento type!");
      }
    }
    Map localMap = (Map)paramObject;
    localMap.put("y.layout.hierarchic.MementoSequencer.SequencerMemento", this.a);
  }
  
  public bb[] a(o paramo, x paramx, int paramInt)
  {
    int i1 = f.o;
    int n = f.n;
    if (i1 == 0)
    {
      if (this.a != null)
      {
        if (i1 != 0) {
          break label191;
        }
        if (!this.d) {
          break label190;
        }
      }
      if (i1 != 0) {}
    }
    else if (this.a == null)
    {
      this.a = new b_();
    }
    bb[] arrayOfbb = this.b.a(paramo, paramx, paramInt);
    Map localMap = this.a.a;
    int j = 0;
    Object localObject2;
    do
    {
      if (j >= arrayOfbb.length) {
        break;
      }
      if ((i1 == 0) && (n != 0)) {
        break label189;
      }
      localObject2 = arrayOfbb[j];
      int m = 0;
      v localv = ((bb)localObject2).f();
      if (localv != null)
      {
        localMap.put(d(localv.c()), new Integer(m));
        localv = localv.a();
        m++;
      }
      for (;;)
      {
        if (i1 == 0) {
          if (n == 0)
          {
            if (n == 0) {
              break;
            }
            if (i1 != 0) {
              continue;
            }
            j++;
          }
        }
      }
    } while (n == 0);
    label189:
    return arrayOfbb;
    label190:
    label191:
    arrayOfbb = new bb[paramInt];
    int i = arrayOfbb.length - 1;
    do
    {
      while (n == 0)
      {
        if (i < 0) {
          break;
        }
        arrayOfbb[i] = new bb();
        i--;
      }
    } while (i1 != 0);
    Object localObject1 = paramo.v();
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      e locale = ((w)localObject1).d();
      localObject2 = d(locale);
      if (i1 == 0)
      {
        if (this.a.a.get(localObject2) == null) {
          throw new IllegalStateException("No memento stored for " + localObject2);
        }
        arrayOfbb[paramx.getInt(locale)].add(locale);
        ((w)localObject1).f();
      }
    } while (n == 0);
    localObject1 = new ArrayList(arrayOfbb.length);
    int k = 0;
    do
    {
      if (k >= arrayOfbb.length) {
        break;
      }
      if ((i1 == 0) && (n != 0)) {
        break label445;
      }
      localObject2 = arrayOfbb[k];
      if (i1 == 0)
      {
        if (((bb)localObject2).size() > 0)
        {
          ((bb)localObject2).a(this.e);
          ((List)localObject1).add(localObject2);
        }
        k++;
      }
    } while (n == 0);
    label445:
    return (bb[])((List)localObject1).toArray(new bb[((List)localObject1).size()]);
  }
  
  final Object d(Object paramObject)
  {
    Object localObject = this.c.get(paramObject);
    if (f.o == 0) {
      if (localObject == null) {
        throw new IllegalArgumentException("No Id stored for " + paramObject);
      }
    }
    return localObject;
  }
  
  public void a(boolean paramBoolean)
  {
    this.d = paramBoolean;
  }
  
  public void a()
  {
    this.b = null;
    this.c = null;
    this.a = null;
  }
  
  static class b_
    implements Serializable
  {
    Map a = new HashMap();
  }
  
  final class a_
    implements Comparator
  {
    a_() {}
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      return l.a(((Integer)cb.this.a.a.get(cb.this.d(paramObject1))).intValue(), ((Integer)cb.this.a.a.get(cb.this.d(paramObject2))).intValue());
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.cb

 * JD-Core Version:    0.7.0.1

 */